//
//  WXTimerHelper.h
//  打字效果
//
//  Created by tianlong on 2018/3/28.
//  Copyright © 2018年 tianlong. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, TimerState) {
    /** 未创建 */
    TimerStateNone,
    /** 准备 */
    TimerStatePrepare,
    /** 运行 */
    TimerStateRunning,
    /** 暂停 */
    TimerStatePause,
    /** 失效 */
    TimerStateInvalidate
};


@class WXTimerHelper;
@protocol WXTimerHelperDelegate <NSObject>
@optional
- (void)timerHelper:(WXTimerHelper *)timerHelper timerState:(TimerState)timerState;
@end

@interface WXTimerHelper : NSObject
@property (assign, nonatomic, readonly) TimerState timerState;
@property (weak, nonatomic) id<WXTimerHelperDelegate> delegate;
+ (instancetype)scheduledTimerWithTimeInterval:(NSTimeInterval)interval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;
- (void)resume;
- (void)pause;
- (void)stop;
@end
